<div ng-controller="queryGatherFileController">
    <table class="table table-hover">
        <thead>
        <tr>
            <th>id</th>
            <th>文件路径</th>
            <th>归属系统</th>
            <th>采集类型</th>
            <th>分组字段</th>
            <th>分隔符</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="data in dataList">
            <td>{{data.fileId}}</td>
            <td>{{data.filePath}}</td>
            <td>{{data.systemName}}</td>
            <td>{{data.gatherType}}</td>
            <td>{{data.groupFieldPosition}}</td>
            <td>{{data.splitRegex}}</td>
            <td><button ng-click="openModal(data)" type="button" class="btn btn-default">更新</button></td>
        </tr>
        </tbody>
    </table>


<!-- 模态框（Modal） -->
<div class="modal fade bs-example-modal-lg" id="updateGatherFileModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-hidden="true">×
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    采集文件信息
                </h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" role="form">
                    <div class="form-group">
                        <label for="fileId" class="col-sm-2 control-label">文件id</label>
                        <div class="col-sm-2">
                            <input ng-model="chooseRecord.fileId" type="text" class="form-control" id="fileId"
                                   placeholder="请输入名字">
                        </div>
                        <label for="systemName" class="col-sm-2 control-label">系统名</label>
                        <div class="col-sm-2">
                            <input ng-model="chooseRecord.systemName" type="text" class="form-control" id="systemName"
                                   placeholder="请输入名字">
                        </div>
                        <label for="gatherType" class="col-sm-2 control-label">采集类型</label>
                        <div class="col-sm-2">
                            <input ng-model="chooseRecord.gatherType" type="text" class="form-control" id="gatherType"
                                   placeholder="请输入名字">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="filePath" class="col-sm-2 control-label">文件路径</label>
                        <div class="col-sm-8">
                            <input ng-model="chooseRecord.filePath" type="text" class="form-control" id="filePath"
                                   placeholder="请输入名字">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="regex" class="col-sm-2 control-label">分隔符</label>
                        <div class="col-sm-8">
                            <input ng-model="chooseRecord.splitRegex" type="text" class="form-control" id="regex"
                                   placeholder="请输入名字">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="instance" class="col-sm-2 control-label">行样例</label>
                        <div class="col-sm-6">
                            <input ng-model="chooseRecord.instance" type="text" class="form-control" id="instance"
                                   placeholder="请输入名字">
                        </div>
                        <div class="col-sm-1">
                            <button type="submit" ng-click="split(chooseRecord.splitRegex,chooseRecord.instance,chooseRecord.filePath)" class="btn btn-default">分割</button>
                        </div>
                    </div>
                    <div ng-if="splitResult" class="form-group">

                        <div class="col-sm-12" ng-repeat="data in splitResult track by $index">
                            <div class="col-sm-2"></div>
                            <div class="col-sm-10"> ${{$index}} : {{data}}</div>
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="groupFields" class="col-sm-2 control-label">分组字段</label>
                        <div class="col-sm-8">
                            <input ng-model="chooseRecord.groupFieldPosition" type="text" class="form-control" id="groupFields"
                                   placeholder="请输入名字">
                        </div>
                    </div>

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default"
                        data-dismiss="modal">关闭
                </button>
                <button type="button" ng-click="updateGatherFile(chooseRecord.fileId,chooseRecord.systemName,chooseRecord.filePath,chooseRecord.splitRegex,chooseRecord.groupFieldPosition,chooseRecord.instance,chooseRecord.gatherType)" class="btn btn-primary">
                    提交更改
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

</div>